package com.runa.persistence.entity.apportion;

import com.rn.smart.command.dto.valve.contro.YiLinValve;
import com.rn.smart.command.dto.valve.contro.ZheDaValve;
import com.runa.monitor.comm.dto.Node;
import lombok.Data;

/**
 * 2025/2/20 10:10
 * zhangYB
 */
@Data
public class ApportionValveControlParam {

    private String nodeId;
    private Node node;
    private String type;
    private String value;
    private String tolerance;
    private String time;

    public ApportionValveControlParam() {
    }

    public static ApportionValveControlParam getInstance(ZheDaValve valve) {
        ApportionValveControlParam apportionValveControlParam = new ApportionValveControlParam();
        apportionValveControlParam.setNodeId(valve.getNodeId());
        apportionValveControlParam.setType(valve.getType());
        apportionValveControlParam.setValue(valve.getValue());
        apportionValveControlParam.setTolerance(valve.getTolerance());
        apportionValveControlParam.setTime(valve.getTime());
        return apportionValveControlParam;
    }

    public static ApportionValveControlParam getInstance(YiLinValve valve) {
        ApportionValveControlParam apportionValveControlParam = new ApportionValveControlParam();
        apportionValveControlParam.setNodeId(valve.getNodeId());
        apportionValveControlParam.setType(valve.getType());
        apportionValveControlParam.setValue(valve.getValue());
        apportionValveControlParam.setTolerance(valve.getTolerance());
        apportionValveControlParam.setTime(valve.getTime());
        return apportionValveControlParam;
    }

}
